<template>
    <div>
        <Form :label-width="130" inline>
            <Form-item label="救助对象类别：">
                <c-dict-select v-model="queryParam.dbzp0001" dictCode="systemsubtype"/>
            </Form-item>

            <Form-item label="打印模版名称:">
                <c-dict-select v-model="queryParam.dbzp0002" dictCode="printtemplatename"/>
            </Form-item>
            <Row class="button_row">
                <span style="float: left">
                     <Button type="primary" @click="handleAdd">新增 </Button>
                </span>
                <span style="float: right">
                    <Button type="primary" @click="searchQuery">查询</Button>
                 <Button type="primary" class="button_item_left" @click="searchReset">重置</Button>
                </span>
            </Row>
        </Form>
        <div class="table_div">
            <vxe-table border
                       auto-resize
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="dbzp0001_name" title="救助对象类别" align="center"/>
                <vxe-table-column field="dbzp0002_name" title="模版信息" align="center"/>
                <vxe-table-column field="dbzp0003_name" title="是否有效" align="center"/>
                <vxe-table-column field="dbzp0005" title="左右" align="center" :formatter="rightOrLeft"/>
                <vxe-table-column title="操作" align="center" width="200" fixed="right">
                    <template #default="{row}">
                        <Button type="success" size="small" @click="handleDetail(row)" style="margin-right:5px">详情
                        </Button>
                        <Button type="info" size="small" @click="handleEdit(row)" style="margin-right:5px">编辑</Button>
                        <Button type="error" size="small" @click="handleDelete(row.id)" style="margin-right: 5px">删除
                        </Button>
                    </template>
                </vxe-table-column>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
        <ss21010-modal ref="modalForm" @ok="modalFormOk"/>
    </div>

</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'

    import ss21010Modal from './modules/ss21010Modal'

    export default {
        name: "ss21010-list",
        mixins: [CommonMixin],
        components: {
            ss21010Modal
        },
        data() {
            return {
                queryParam: {},
                Loading: true,
                url: {
                    list: "/api/ac/subsistence/Ss21010Service/page",
                    delete: "/api/ac/subsistence/Ss21010Service/delete",
                },

            }
        },
        methods: {
            rightOrLeft(h) {
                if (h.cellValue) {
                    if (h.cellValue == 0) {
                        return "左侧页面"
                    } else {
                        return "右侧页面"
                    }
                }
            }
        },
        created() {
            this.loadData();
        },
    }
</script>

<style scoped>
    .paging {
        float: right;
        margin-top: 10px;
    }

    /deep/ .ivu-upload-list {
        display: none;
    }

    /deep/ .ivu-table-cell {
        padding-right: 0px;
        padding-left: 0px;
    }

    /deep/ #area .ivu-col-span-8 {
        width: 50%;
    }

    #area :nth-child(3) {
        display: none;
    }
</style>